{extend name="public:adminbase" /}

{block name="content"}


<style>
  .form-group {
    margin-bottom: 40px;
  }
</style>
<div class="container-fluid p-t-15">

  <div class="row">
    <div class="col-lg-8">
      <div class="card">

        <div class="card-header"><h4>网站基础设置</h4></div>
        <ul class="nav nav-tabs nav-justified">
            <li class=" nav-item active">
                <a data-toggle="tab" href="#safe" aria-expanded="true">安全设置</a>
            </li>
          <li class="nav-item">
            <a data-toggle="tab" href="#home-basic" aria-expanded="false">基本配置</a>
          </li>
          <li class="nav-item">
            <a data-toggle="tab" href="#profile-basic" aria-expanded="false">百家号同步设置</a>
          </li>
          <li class="nav-item">
            <a data-toggle="tab" href="#messages-basic" aria-expanded="false">百度站长自动提交</a>
          </li>

        </ul>
        <form onsubmit="return false;" method="post" name="edit-form" class="edit-form">
        <div class="tab-content">
            <div id="safe" class="tab-pane active">
                <div class="form-group">
                    <label class="btn-block">站点开关</label>
                    <div class="example-box">
                        <label class="lyear-radio radio-inline radio-primary">
                            <input type="radio" name="webststus" value="1"
                                   {if config('web.webststus') == 1}checked{/if}><span>开启</span>
                        </label>
                        <label class="lyear-radio radio-inline radio-primary">
                            <input type="radio" name="webststus" value="0"
                                   {if config('web.webststus') == 0}checked{/if}><span>关闭</span>
                        </label>

                    </div>
                    <small class="help-block">站点关闭后将不能访问，后台可正常登录</small>
                </div>

                <div class="form-group">
                    <label class="btn-block">开启Ip验证</label>
                    <div class="example-box">
                        <label class="lyear-radio radio-inline radio-primary">
                            <input type="radio" name="webip" value="1"
                                   {if config('web.webip') == 1}checked{/if}><span>开启</span>
                        </label>
                        <label class="lyear-radio radio-inline radio-primary">
                            <input type="radio" name="webip" value="0"
                                   {if config('web.webip') == 0}checked{/if}><span>关闭</span>
                        </label>

                    </div>
                    <small class="help-block">开启后，同一个ip在短时间内不能访问过高，否则会自动被拉入黑名单</small>
                </div>

                <div class="form-group">
                    <label for="cdn">cdn设置</label>
                    <input class="form-control"
                           type="text"
                           id="cdn"
                           name="cdn"
                           value="{:config('web.cdn')}"
                           placeholder="请输入" >
                    <small class="help-block">调用方式：<code>config('web.cdn')</code>
                    ，cdn域名填写，用于加速网站图片打开速度。以http开头,结尾没有/
                    </small>
                </div>
            </div>


          <div id="home-basic" class="tab-pane">

              <div class="form-group">
                <label for="web_site_title">网站标题</label>
                <input class="form-control"
                       type="text"
                       id=""
                       name="web_title"
                       value="{:config('web.web_title')}"
                       placeholder="请输入站点标题" >
                <small class="help-block">调用方式：<code>config('web.web_title')</code></small>
              </div>

              <div class="form-group">
                <label for="web_site_title">400电话</label>
                <input class="form-control"
                       type="text"
                       name="web_tel"
                       value="{:config('web.web_tel')}"
                       placeholder="请输入400电话" >
                <small class="help-block">调用方式：<code>config('web.web_tel')</code></small>
              </div>

              <div class="form-group">
                <label for="web_site_title">客服1</label>
                <input class="form-control"
                       type="text"
                       name="web_tel"
                       value="{:config('web.kefu1')}"
                       placeholder="请输入400电话" >
                <small class="help-block">调用方式：<code>config('web.kefu1')</code></small>
              </div>

              <div class="form-group">
                <label for="web_site_title">客服2</label>
                <input class="form-control"
                       type="text"
                       name="web_tel"
                       value="{:config('web.kefu2')}"
                       placeholder="请输入400电话" >
                <small class="help-block">调用方式：<code>config('web.kefu2')</code></small>
              </div>

              <div class="form-group">
                <label for="web_site_title">客服3</label>
                <input class="form-control"
                       type="text"
                       name="web_tel"
                       value="{:config('web.kefu3')}"
                       placeholder="请输入400电话" >
                <small class="help-block">调用方式：<code>config('web.kefu3')</code></small>
              </div>


              <div class="form-group">
                <label for="web_site_title">客服4</label>
                <input class="form-control"
                       type="text"
                       name="web_tel"
                       value="{:config('web.kefu4')}"
                       placeholder="请输入400电话" >
                <small class="help-block">调用方式：<code>config('web.kefu4')</code></small>
              </div>

              <div class="form-group">
                <label for="web_site_keywords">站点关键词</label>
                <input class="form-control"
                       type="text" id="web_site_keywords"
                       name="web_keywords"
                       value="{:config('web.web_keywords')}" placeholder="请输入站点关键词" >
                <small class="help-block">网站搜索引擎关键字 <code>config('web.web_keywords')</code></small>
              </div>

              <div class="form-group">
                <label>LOGO图片_后台</label>
                <div class="input-group">
                  {:uploader('logo',config('web.logo'))}
                </div>
                <small class="help-block">调用方式：<code>config('web.logo')</code></small>
              </div>

              <div class="form-group">
                <label>LOGO图片_前台</label>
                <div class="input-group">
                  {:uploader('logoIndex',config('web.logoIndex'))}
                </div>
                <small class="help-block">调用方式：<code>config('web.logoIndex')</code></small>
              </div>


              <div class="form-group">
                <label for="web_site_description">站点描述</label>
                <textarea class="form-control"
                          id="web_site_description" rows="5"
                          name="web_description" placeholder="请输入站点描述" >{:config('web.web_description')}</textarea>
                <small class="help-block">网站描述，有利于搜索引擎抓取相关信息<code>config('web.web_description')</code></small>
              </div>
              <div class="form-group">
                <label for="web_site_copyright">版权信息</label>
                <input class="form-control" type="text"
                       id="web_site_copyright"
                       name="web_site_copyright" value="{:config('web.web_site_copyright')}" placeholder="请输入版权信息" >
                <small class="help-block">调用方式：<code>config('web.web_site_copyright')</code></small>
              </div>
              <div class="form-group">
                <label for="web_site_icp">备案信息</label>
                <input class="form-control"
                       type="text" id="web_site_icp"
                       name="icp" value="{:config('web.icp')}" placeholder="请输入备案信息" >
                <small class="help-block">调用方式：<code>config('web.icp')</code></small>
              </div>

          </div>

          <div class="tab-pane fade" id="profile-basic">
            <div class="form-group">
              <label for="web_site_title">app_id</label>
              <input class="form-control"
                     type="text"
                     id="web_site_title"
                     name="app_id"
                     value="{:config('web.app_id')}"
                     placeholder="请输入" >
              <small class="help-block">调用方式：<code>config('web.app_id')</code></small>
            </div>

            <div class="form-group">
              <label>app_token</label>
              <input class="form-control"
                     type="text"
                     name="app_token"
                     value="{:config('web.app_token')}"
                     placeholder="请输入app_token" >
              <small class="help-block">调用方式：<code>config('web.app_token')</code></small>
            </div>

            <div class="form-group">
              <small class="help-block">温馨提示：<code>
                先开通百度百家号，在开发->基本配置 中找到相应数据填写，可一键同步文章到百家号。
              </code></small>
            </div>

          </div>

          <div id="messages-basic" class="tab-pane ">

              <div class="form-group">
                <label class="btn-block" for="">自动提交</label>
                <div class="example-box">
                  <label class="lyear-radio radio-inline radio-primary">
                    <input type="radio" name="autopushststus" value="1"
                           {if config('baiduzhanzhang.autopushststus') == 1}checked{/if}><span>开启</span>
                  </label>
                  <label class="lyear-radio radio-inline radio-primary">
                    <input type="radio" name="autopushststus" value="0"
                           {if config('baiduzhanzhang.autopushststus') == 0}checked{/if}><span>关闭</span>
                  </label>
                </div>
                <small class="help-block">config('baiduzhanzhang.autopushststus')开启添加文章自动提交百度站长平台[新文章添加后，自动触发百度站长url提交]</small>
              </div>

              <div class="form-group">
                <label for="web_site_title">接口调用地址</label>
                <input class="form-control"
                       type="text"
                       id=""
                       name="url"
                       value="{:config('baiduzhanzhang.url')}"
                       placeholder="请输入站点标题" >
                <small class="help-block">调用方式：<code>config('baiduzhanzhang.url')</code></small>
                <a href="https://micuer.com/new/448.html" target="_blank" class="btn btn-xs btn-primary">如何获取</a>
              </div>
          </div>

          <div id="kefu" class="tab-pane ">


          </div>
        </div>
        </form>
        <div class="form-group" style="padding: 25px;">
          <button type="submit" onclick="formsub()" class="btn btn-primary m-r-5">确 定</button>
          <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
      </div>
    </div>

  </div>

</div>
{include file="public/afooter"}
<script>

  function formsub() {
    var data = $("form").serialize();
    var url = "{:url('AdminSetting/save')}"
    $.post(url,data,function (e) {
      if(e.code != 200){
        error(e.msg);
      }else {
        success(e.msg);
        setTimeout(location.reload(), 1000);

      }
    })
  }
//  新增
  function AddCate(obj) {
    var url = $(obj).attr('href');
    layer.open({
      title:"新增分类",
      type: 2,
      area: ['500px', '450px'],
      fixed: false, //不固定
      maxmin: true,
      content: url
    });
  }
//修改
//  function edit(obj) {
//    var url = $(obj).attr('href');
//    layer.open({
//      title:"修改",
//      type: 2,
//      area: ['500px', '450px'],
//      fixed: false, //不固定
//      maxmin: true,
//      content: url
//    });
//  }
//  删除
  function del(id) {
    layer.confirm('您确定要删除吗？', {
      btn: ['确定','取消'] //按钮
    }, function(){
      var url = "{:url('AdminCate/delete')}"
      $.post(url,{id:id},function (e) {
        if(e.code != 200){
          error(e.msg);
        }else {
          success(e.msg);
          var index = parent.layer.getFrameIndex(window.name);
          setTimeout(function(){parent.layer.close(index)}, 1000);
          window.parent.location.reload();
        }
      })
    }, function(){
      layer.msg('已取消');
    });
  }

  //修改置顶状态
  function change_top(id) {
    var url ="{:url('change_top')}";
    $.post(url,{id:id},function (e) {
      if(e.code ==200){
        success(e.msg);
        setTimeout(location.reload(),1000);
      } else {
        error(e.msg);
      }
    })
  }
  //修改推荐状态

function change_recommend(id) {
  var url ="{:url('change_recommend')}";
  $.post(url,{id:id},function (e) {
    if(e.code ==200){
      success(e.msg);
      setTimeout(location.reload(),1000);
    } else {
      error(e.msg);
    }
  })
}
</script>

{/block}